<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 1.需求  取出所有实参中的最大值

      function fn() {
        var a1 = arguments[0];
        for (var i = 0; arguments.length > i; i++) {
          if (arguments[i] > a1) {
            a1 = arguments[i];
          }
        }
        return a1;
      }
      var a2 = fn(1, 4, 6, 8, 111, 666);
      console.log(a2);
    </script>
  </body>
</html>
